package com.mzy.olddate.streamtest;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Ives
 * * @date 2021/9/14
 */
public class demo {
  public static void main(String[] args) {
    Integer a=20;
    String format = String.format("%02d", a);
    System.out.println(format);

    ArrayList<String> list = new ArrayList<>();
    list.add("1");
    list.add("2");
    list.add("3");
    list.add("4");
    list.add("5");


    System.out.println(demo(list));
  }

  public static String demo(List<String> list){
    for (int i = 0; i < list.size(); i++) {
      if (list.get(i).equals("3")){
        return "结束了";
      }
      System.out.println("索引"+i);
    }
    return "结束不了了";
  }
}
